package com.gbb.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;

import com.gbb.ipc.IMyAidlInterface;

/**
 * @author gaobingbing91 on 2016/11/12.
 */
public class RemoteService extends Service {

    private static final String TAG = RemoteService.class.getSimpleName();

    @Override
    public IBinder onBind(Intent intent){
        return new RemoteBinderStub();
    }

    @Override
    public void onCreate(){
        super.onCreate();
        Log.d(TAG,"_onCreate()");
    }

    private class RemoteBinderStub extends IMyAidlInterface.Stub {

        @Override
        public String hello(String name) throws RemoteException{
            Log.d(TAG,"_hello()=>" + name);
            return "hello:" + name;
        }

    }

}
